package com.cskaoyan.last.print;

/**
 * 打印线程
 *
 * @author 徐文祥
 * @since 2023/05/09 21:33
 */
public class NumberPrinter extends Thread {

    private Printer printer;
    private int i = 1;

    public NumberPrinter(Printer printer) {
        this.printer = printer;
    }

    @Override
    public void run() {
        while (true) {
            printer.print(i);
            if (i == 52) {

                break;
            }
            i++;

        }
    }
}
